var _EsdDynamicTransformationFunction = function($){
/**
* 命名空间定义
*/
var _EsdDynamicTransformationScript = {};
_EsdDynamicTransformationScript.navBlock = {}; // 定义区域跳转类
_EsdDynamicTransformationScript.navBlock.selector = {};
/**
* 文本链接 a
*/
//保证所有a标签都有href
$("a").each(function(){

var aHref = this.href;
if( aHref=="" || aHref==undefined ){
$(this).attr("href","javascript:void(0)");
}

//给a标签加title
var aTitle = this.title;
var aText = this.text;

if( aTitle=="" || aTitle==undefined ){
if( aText!="" || aText!=undefined ){
$(this).attr("title",$.trim(aText));
}
}

});


//select下的option添加title
$("option").each(function(){
var oTitle = this.title;
var oText = this.text;
if( oTitle=="" || oTitle==undefined ){
if( oText!="" || oText!=undefined ){
$(this).attr("title",$.trim(oText));
}
}
});


//搜索
$(".header .sliderbar .search form input:last").attr("title","请输入搜索内容");
$(".header .sliderbar .search form input:last").attr("placeholder","请输入搜索内容");
$(".header .sliderbar .search form button").attr("title","搜索");
/**
* 图片处理片段
*/

$('img[src="./tpxw/201909/W020190925516500132432.jpg"]').attr('title','省能源局召开干部职工大会').attr('alt','省能源局召开干部职工大会');$('img[src="./sytplj/201812/W020181214396760108746.gif"]').attr('title','能源新干线').attr('alt','能源新干线');$('img[src="./yqlj/tplj/201812/W020181213546737911672.gif"]').attr('title','中国能源网标志').attr('alt','中国能源网标志');$('img[src="./sytplj/201812/W020181214396235339329.gif"]').attr('title','互动交流').attr('alt','互动交流');$('img[src="./images/red.png"]').attr('title','党政机关').attr('alt','党政机关');$('img[src="./tpxw/201907/W020190724585502929001.jpg"]').attr('title','吉林省惠企惠民政策手册').attr('alt','吉林省惠企惠民政策手册');$('img[src="./tpxw/201904/W020190423336404033324.png"]').attr('title','国务院“互联网+督查”平台上线').attr('alt','国务院“互联网+督查”平台上线');$('img[src="./yqlj/tplj/201812/W020181213552065937421.jpg"]').attr('title','吉林省发改委标志').attr('alt','吉林省发改委标志');$('img[src="./images/beian.png"]').attr('title','吉公网安备').attr('alt','吉公网安备');$('img[src="./yqlj/tplj/201812/W020181213545803627482.gif"]').attr('title','中国新能源网标志').attr('alt','中国新能源网标志');$('img[src="./yqlj/tplj/201812/W020181213544421266008.png"]').attr('title','吉林省能源信息服务平台标志').attr('alt','吉林省能源信息服务平台标志');$('img[src="./yqlj/tplj/201812/W020181213547432816781.gif"]').attr('title','中华人民共和国发改委标志').attr('alt','中华人民共和国发改委标志');$('img[src="./tpxw/201908/W020190828508746098253.jpg"]').attr('title','新修订政府信息公开条例解读').attr('alt','新修订政府信息公开条例解读');$('img[src="./sytplj/201812/W020181214520142073246.jpg"]').attr('title','学习园地').attr('alt','学习园地');$('img[src="http://121.43.68.40/exposure/images/jiucuo.png?v=2200000036"]').attr('title','装饰图片').attr('alt','装饰图片');$('img[src="./yqlj/tplj/201812/W020181213548026668735.gif"]').attr('title','国家能源局标志').attr('alt','国家能源局标志');$('img[src="./yqlj/tplj/201812/W020181213545194104333.gif"]').attr('title','中国煤炭信息网标志').attr('alt','中国煤炭信息网标志');$('img[src="./yqlj/tplj/201812/W020181213552713574163.jpg"]').attr('title','吉林省人民政府标志').attr('alt','吉林省人民政府标志');

//img
$("img").each(function(){
//给图片加alt/title
var imgAlt = this.alt,
imgTitle = this.title,
imgSrc = this.src,
parentText = this.parentElement.text;

if(this.alt=="" || this.alt==undefined){
if(imgTitle!="" && imgTitle!=undefined){
$(this).attr("alt",imgTitle);
}else if(parentText!="" && parentText!=undefined){
$(this).attr("alt",parentText);
}
}
if(this.title=="" || this.title==undefined){
if(imgAlt!="" && imgAlt!=undefined){
$(this).attr("title",imgAlt);
}else if(parentText!="" && parentText!=undefined){
$(this).attr("title",parentText);
}
}
})

$("img").each(function(){
if( (this.alt=="" && this.title=="")||(this.alt==undefined && this.title==undefined) ){
$(this).attr("title","图片");
$(this).attr("alt","图片");
}
})
/**
* 共通头部
*/
$("iframe:eq(0)").attr("title","天气预报");
/**
* 主导航
*/
/**
* 首页所有幻灯片
*/



// 首页
if(location.href=="http://nyj.jl.gov.cn/" || location.href=="http://nyj.jl.gov.cn/index.html"){


var part_First = function(){

//轮播,右下角原点--鼠标点击触发情况

//轮播：只获取轮播中一个a标签。
//以文字a标签为主，图片a标签尽量不要，title不稳定

//轮播前的标签
_EsdDynamicTransformationScript.esdTagFrontNum1 = $(".header .sliderbar .search form button");

//文字A标签
_EsdDynamicTransformationScript.esdTagANum1 = $(".main .carousel .picBox:eq(0) .title a");
_EsdDynamicTransformationScript.esdTagANum2 = $(".main .carousel .picBox:eq(1) .title a");
_EsdDynamicTransformationScript.esdTagANum3 = $(".main .carousel .picBox:eq(2) .title a");
_EsdDynamicTransformationScript.esdTagANum4 = $(".main .carousel .picBox:eq(3) .title a");

//原点
_EsdDynamicTransformationScript.esdTagCircleNum1 = $(".main .carousel .parge span:eq(0) a");
_EsdDynamicTransformationScript.esdTagCircleNum2 = $(".main .carousel .parge span:eq(1) a");
_EsdDynamicTransformationScript.esdTagCircleNum3 = $(".main .carousel .parge span:eq(2) a");
_EsdDynamicTransformationScript.esdTagCircleNum4 = $(".main .carousel .parge span:eq(3) a");

//轮播后的标签
_EsdDynamicTransformationScript.esdTagAfterNum1 = $(".jc-modal-lar .modal-tit a");

//轮播前的焦点
_EsdDynamicTransformationScript.esdTagFrontNum1.focus(function (e) {
$(this).bind("keydown.keydown_0", function (e) {
if(e.shiftKey&&e.keyCode==9){

}else if (e.keyCode == 9) {
_EsdDynamicTransformationScript.esdTagCircleNum1.click();
_EsdDynamicTransformationScript.esdTagANum1.focus();
return false;
}
});
});
_EsdDynamicTransformationScript.esdTagFrontNum1.blur(function () {
$(this).unbind("keydown.keydown_0");
});

//第一块
_EsdDynamicTransformationScript.esdTagANum1.focus(function (e) {
$(this).bind("keydown.keydown_1", function (e) {
if(e.shiftKey&&e.keyCode==9){
_EsdDynamicTransformationScript.esdTagFrontNum1.focus();
return false;
}else if (e.keyCode == 9) {
_EsdDynamicTransformationScript.esdTagCircleNum2.click();
_EsdDynamicTransformationScript.esdTagANum2.focus();
return false;
}
});
});
_EsdDynamicTransformationScript.esdTagANum1.blur(function () {
$(this).unbind("keydown.keydown_1");
});

//第二块
_EsdDynamicTransformationScript.esdTagANum2.focus(function (e) {
$(this).bind("keydown.keydown_2", function (e) {
if(e.shiftKey&&e.keyCode==9){
_EsdDynamicTransformationScript.esdTagCircleNum1.click();
_EsdDynamicTransformationScript.esdTagANum1.focus();
return false;
}else if (e.keyCode == 9) {
_EsdDynamicTransformationScript.esdTagCircleNum3.click();
_EsdDynamicTransformationScript.esdTagANum3.focus();
return false;
}
});
});
_EsdDynamicTransformationScript.esdTagANum2.blur(function () {
$(this).unbind("keydown.keydown_2");
});

//第三块
_EsdDynamicTransformationScript.esdTagANum3.focus(function (e) {
$(this).bind("keydown.keydown_3", function (e) {
if(e.shiftKey&&e.keyCode==9){
_EsdDynamicTransformationScript.esdTagCircleNum2.click();
_EsdDynamicTransformationScript.esdTagANum2.focus();
return false;
}else if (e.keyCode == 9) {
_EsdDynamicTransformationScript.esdTagCircleNum4.click();
_EsdDynamicTransformationScript.esdTagANum4.focus();
return false;
}
});
});
_EsdDynamicTransformationScript.esdTagANum3.blur(function () {
$(this).unbind("keydown.keydown_3");
});

//第四块
_EsdDynamicTransformationScript.esdTagANum4.focus(function (e) {
$(this).bind("keydown.keydown_4", function (e) {
if(e.shiftKey&&e.keyCode==9){
_EsdDynamicTransformationScript.esdTagCircleNum3.click();
_EsdDynamicTransformationScript.esdTagANum3.focus();
return false;
}else if (e.keyCode == 9) {
_EsdDynamicTransformationScript.esdTagAfterNum1.focus();
return false;
}
});
});
_EsdDynamicTransformationScript.esdTagANum4.blur(function () {
$(this).unbind("keydown.keydown_4");
});

//轮播后的焦点
_EsdDynamicTransformationScript.esdTagAfterNum1.focus(function (e) {
$(this).bind("keydown.keydown_5", function (e) {
if(e.shiftKey&&e.keyCode==9){
_EsdDynamicTransformationScript.esdTagCircleNum4.click();
_EsdDynamicTransformationScript.esdTagANum4.focus();
return false;
}else if (e.keyCode == 9) {

}
});
});
_EsdDynamicTransformationScript.esdTagAfterNum1.blur(function () {
$(this).unbind("keydown.keydown_5");
});


}


}
/**
* 主页js
*/
if (window.location.href == 'http://nyj.jl.gov.cn/' || window.location.href == 'http://nyj.jl.gov.cn/index.htm') {
//首页


// 总计时器，保证目标加载完毕再执行js（轮播+国务院）
_EsdDynamicTransformationScript.intervalNyj = setInterval(function(){

if( ( $(".main .carousel .picBox:eq(3) .title a") != undefined )
&& ( $("#szflist a:last") != undefined ) ){
clearInterval(_EsdDynamicTransformationScript.intervalNyj);

part_First();
part_Second();

}

}, 500);





var part_Second = function(){

//国务院-省政府信息
_EsdDynamicTransformationScript.esdTag_nyj_gwySzfTitle1 = $(".m-r-0:eq(0) .modal-tit span:eq(0) a:eq(0)");
_EsdDynamicTransformationScript.esdTag_nyj_gwySzfTitle2 = $(".m-r-0:eq(0) .modal-tit span:eq(1) a:eq(0)");

_EsdDynamicTransformationScript.esdTag_nyj_gwySzfBoxNUm1Start = $("#gwylist a:first");
_EsdDynamicTransformationScript.esdTag_nyj_gwySzfBoxNUm2Start = $("#szflist a:first");

_EsdDynamicTransformationScript.esdTag_nyj_gwySzfBoxNUm1End = $("#gwylist a:last");
_EsdDynamicTransformationScript.esdTag_nyj_gwySzfBoxNUm2End = $("#szflist a:last");

//国务院
_EsdDynamicTransformationScript.esdTag_nyj_gwySzfTitle1.focus(function (e) {
//			showgwy();
e = $(this).mouseover();
$(document).bind("keydown.keydown_1", function (e) {
if(e.shiftKey&&e.keyCode==9){

}else if (e.keyCode == 9) {
_EsdDynamicTransformationScript.esdTag_nyj_gwySzfBoxNUm1Start.focus()
return false;
}
});
});
_EsdDynamicTransformationScript.esdTag_nyj_gwySzfTitle1.blur(function () {
$(document).unbind("keydown.keydown_1");
});

_EsdDynamicTransformationScript.esdTag_nyj_gwySzfBoxNUm1Start.focus(function () {
$(document).bind("keydown.keydown_s1", function (e) {
if (e.shiftKey && e.keyCode == 9) {
_EsdDynamicTransformationScript.esdTag_nyj_gwySzfTitle1.focus();
return false;
}else if (e.keyCode == 9) {

}
});
});
_EsdDynamicTransformationScript.esdTag_nyj_gwySzfBoxNUm1Start.blur(function () {
$(document).unbind("keydown.keydown_s1");
});

_EsdDynamicTransformationScript.esdTag_nyj_gwySzfBoxNUm1End.focus(function () {
$(document).bind("keydown.keydown_e1", function (e) {
if(e.shiftKey&&e.keyCode==9){

} else if (e.keyCode == 9) {
_EsdDynamicTransformationScript.esdTag_nyj_gwySzfTitle2.mouseover();
_EsdDynamicTransformationScript.esdTag_nyj_gwySzfTitle2.focus();
return false;
}
});
});
_EsdDynamicTransformationScript.esdTag_nyj_gwySzfBoxNUm1End.blur(function () {
$(document).unbind("keydown.keydown_e1");
});

//省政府
_EsdDynamicTransformationScript.esdTag_nyj_gwySzfTitle2.focus(function (e) {
//			showszf();
//			e = $(this).mouseover();
$(document).bind("keydown.keydown_2", function (e) {
if(e.shiftKey&&e.keyCode==9){
//					showgwy();
_EsdDynamicTransformationScript.esdTag_nyj_gwySzfTitle1.mouseover();
_EsdDynamicTransformationScript.esdTag_nyj_gwySzfBoxNUm1End.focus();
return false;
}else if (e.keyCode == 9) {
_EsdDynamicTransformationScript.esdTag_nyj_gwySzfBoxNUm2Start.focus();
return false;
}
});
});
_EsdDynamicTransformationScript.esdTag_nyj_gwySzfTitle2.blur(function () {
$(document).unbind("keydown.keydown_2");
});

_EsdDynamicTransformationScript.esdTag_nyj_gwySzfBoxNUm2Start.focus(function () {
$(document).bind("keydown.keydown_s2", function (e) {
if (e.shiftKey && e.keyCode == 9) {
_EsdDynamicTransformationScript.esdTag_nyj_gwySzfTitle2.focus();
return false;
}else if (e.keyCode == 9) {

}
});
});
_EsdDynamicTransformationScript.esdTag_nyj_gwySzfBoxNUm2Start.blur(function () {
$(document).unbind("keydown.keydown_s2");
});


}



}
/**
* 二级页
*/

// -------------------------------二级页------------------------------------

if(location.href=="http://nyj.jl.gov.cn/zwgk/zfxxgk/xxgkyjx/"){
$("iframe:eq(1)").attr("title","填写信息公开意见");

_EsdDynamicTransformationScript.slidePointIntervalts = setInterval(function () {
if ( document.getElementsByTagName("iframe")[1].contentWindow.document.getElementById("SubmitButton") != undefined ) {
clearInterval(_EsdDynamicTransformationScript.slidePointIntervalts);

var inputIframe = document.getElementsByTagName("iframe")[1].contentWindow.document;
$(inputIframe).find("#frmData input:eq(0)").attr({placeholder:"姓名",title:"姓名"});
$(inputIframe).find("#frmData input:eq(1)").attr({placeholder:"联系电话",title:"联系电话"});
$(inputIframe).find("#frmData input:eq(2)").attr({placeholder:"是否公开，是",title:"是否公开，是"});
$(inputIframe).find("#frmData input:eq(3)").attr({placeholder:"是否公开，否",title:"是否公开，否"});
$(inputIframe).find("#frmData input:eq(4)").attr({placeholder:"主题",title:"主题"});

$(inputIframe).find("#SubmitButton").attr("title","提交");
$(inputIframe).find("#ResetButton").attr("title","重置");

}
}, 500);




}

/**
* 共通底部处理
*/

$("#jumpMenu1").attr("title","国家和各能源局网站");
$("#jumpMenu2").attr("title","省政府和直属部门网站");
$("#jumpMenu3").attr("title","能源相关网站");

//公共的
_EsdDynamicTransformationScript.navBlock.selector.top = ".header";
_EsdDynamicTransformationScript.navBlock.selector.nav = ".nav";
_EsdDynamicTransformationScript.navBlock.selector.footer = ".footer";
_EsdDynamicTransformationScript.navBlock.selector.main = ".main";

if(window.location.href == 'http://nyj.jl.gov.cn/' || window.location.href =='http://nyj.jl.gov.cn/index.html'){

_EsdDynamicTransformationScript.navBlock.selector.left = "#left";
_EsdDynamicTransformationScript.navBlock.selector.right = "#right";
_EsdDynamicTransformationScript.navBlock.selector.content = "#content";
//给栏目的class属性添加navBlock值来标识这是需要切的栏目区块。

$(".flash").addClass("navBlock");
$(".nav").addClass("navBlock");
$(".sliderbar").addClass("navBlock");
$("#slideImg").addClass("navBlock");
$(".footer-informetion").addClass("navBlock");
$(".yqlj").addClass("navBlock");
$(".carousel").addClass("navBlock");
$(".jc-modal-lar").addClass("navBlock");
$(".ad").addClass("navBlock");
$(".jc-modal-s:eq(0)").addClass("navBlock");
$(".jc-modal-s:eq(1)").addClass("navBlock");
$(".jc-modal-s:eq(2)").addClass("navBlock");
$(".jc-modal-s:eq(3)").addClass("navBlock");
$(".jc-modal-s:eq(4)").addClass("navBlock");
$(".jc-modal-s:eq(5)").addClass("navBlock");
$(".jc-modal-ss:eq(0)").addClass("navBlock");
$(".jc-modal-ss:eq(1)").addClass("navBlock");
$(".jc-modal-ss:eq(2)").addClass("navBlock");
}

if(window.location.href == 'http://nyj.jl.gov.cn/jgzn/jgzn/' || window.location.href == 'http://nyj.jl.gov.cn/gzdt/' || window.location.href == 'http://nyj.jl.gov.cn/zwgk/zfxxgk/xxgkzn/' || window.location.href == 'http://nyj.jl.gov.cn/fwpt/bszn/' || window.location.href == 'http://nyj.jl.gov.cn/tzgg/tzgg/' || window.location.href == 'http://nyj.jl.gov.cn/zcfg/' || window.location.href == 'http://nyj.jl.gov.cn/hdjl/zcjd/' || window.location.href == 'http://nyj.jl.gov.cn/rsxx/' || window.location.href == 'http://nyj.jl.gov.cn/ztzl/xxyd/' || window.location.href == 'http://nyj.jl.gov.cn/tzgg/ghjh/' || window.location.href == 'http://nyj.jl.gov.cn/jdjbzl/' || window.location.href == 'http://nyj.jl.gov.cn/lxwm/' || window.location.href == 'http://nyj.jl.gov.cn/zwgk/qzqd/xzqr/'){

_EsdDynamicTransformationScript.navBlock.selector.left = "#left";
_EsdDynamicTransformationScript.navBlock.selector.right = "#right";
_EsdDynamicTransformationScript.navBlock.selector.content = "#content";
//给栏目的class属性添加navBlock值来标识这是需要切的栏目区块。

$(".flash").addClass("navBlock");
$(".nav").addClass("navBlock");
$(".sliderbar").addClass("navBlock");
$("#slideImg").addClass("navBlock");
$(".footer-informetion").addClass("navBlock");
$(".yqlj").addClass("navBlock");
$(".m-l").addClass("navBlock");
$(".m-r").addClass("navBlock");
}

if(location.href=="http://nyj.jl.gov.cn/zwgk/zfxxgk/xxgkyjx/"){

_EsdDynamicTransformationScript.navBlock.selector.content = ".contents";
$(".flash").addClass("navBlock");
$(".nav").addClass("navBlock");
$(".sliderbar").addClass("navBlock");
$(".yqlj").addClass("navBlock");
$("#slideImg").addClass("navBlock");
$(".footer-informetion").addClass("navBlock");
}


if(window.location.href != 'http://nyj.jl.gov.cn/' && window.location.href !='http://nyj.jl.gov.cn/index.html'){

_EsdDynamicTransformationScript.navBlock.selector.left = ".m-l";
_EsdDynamicTransformationScript.navBlock.selector.right = ".m-r";
if( $(".m-content").length>0 ){
_EsdDynamicTransformationScript.navBlock.selector.content = ".m-content";
}

$(".main").addClass("navBlock");
$(".m-l").addClass("navBlock");
$(".m-r").addClass("navBlock");
$(".contents").addClass("navBlock");
$(".m-content").addClass("navBlock");

}

/**
* 区域导航、调试开关
*/

$(document).bind("keydown.keydown_9001", function(e) {
if (e.shiftKey && e.keyCode == 20) {
$("*").focus(function() {
$(this).css({
"outline" : "2px dashed red"
});
});
$("*").blur(function() {
$(this).css({
"outline" : "0px black"
});
});
}
});

_EsdDynamicTransformationScript.navBlock.debug = true; // 是否是调试模式，调试模式有红边线，非调试模式关闭红边框
_EsdDynamicTransformationScript.navBlock.selector.activate = ".navBlock"; // 激活的采用class因为会激活多个
// 快捷键定义区
//_EsdDynamicTransformationScript.navBlock.key = {};

//_EsdDynamicTransformationScript.navBlock.key.top = "alt+1"; // (top)
//_EsdDynamicTransformationScript.navBlock.key.nav = "alt+2"; // (nav)
//_EsdDynamicTransformationScript.navBlock.key.main = "alt+3"; // (main)
//_EsdDynamicTransformationScript.navBlock.key.content = "alt+4"; // (content)
//_EsdDynamicTransformationScript.navBlock.key.left = "alt+5"; // (left)
//_EsdDynamicTransformationScript.navBlock.key.right = "alt+6"; // (right)
//_EsdDynamicTransformationScript.navBlock.key.footer = "alt+7"; // (footer)
//_EsdDynamicTransformationScript.navBlock.key.down = "alt+8"; // (down)
//_EsdDynamicTransformationScript.navBlock.key.up = "alt+9"; // (up);

// 以下变量主要用于区块跳转
_EsdDynamicTransformationScript.navBlock.sIndex = -1; // 当前栏目下标
_EsdDynamicTransformationScript.navBlock.maxIndex = -1; // 保存目前所有class="navBlock"的区域块总数量，栏目总量下标。
_EsdDynamicTransformationScript.navBlock.minIndex = 0; // 栏目数量起始下标

// 主要代码区域

// 导航跳转
_EsdDynamicTransformationScript.navBlock.keyShowSelect = function(i) {
$(_EsdDynamicTransformationScript.navBlock.selector.activate).each(function(index, el) {
if (i == index) {
_EsdDynamicTransformationScript.navBlock.debugView(el);
$(el).find("a").each(function(i, e) {
if (i == 0) {
$(e).focus();
}
});

}
});
}

// 获取所有class=navBlock的区域的总数量，初始化轮训所有需要跳转的块
$(_EsdDynamicTransformationScript.navBlock.selector.activate).each(function(index, ehx) {
_EsdDynamicTransformationScript.navBlock.maxIndex++;
});



// 快捷键功能区域
// 跳转到头部alt+1(49)
$(document).keydown(function(e) {
if (e.altKey && e.keyCode == 49) {
_EsdDynamicTransformationScript.navBlock.keySelectScroll(_EsdDynamicTransformationScript.navBlock.selector.top);
}

});
// 跳转到导航alt+2(50)
$(document).keydown(function(e) {
if (e.altKey && e.keyCode == 50) {
_EsdDynamicTransformationScript.navBlock.keySelectScroll(_EsdDynamicTransformationScript.navBlock.selector.nav);
}

});
// 跳转到主要区域alt+3(51)
$(document).keydown(function(e) {
if (e.altKey && e.keyCode == 51) {
_EsdDynamicTransformationScript.navBlock.keySelectScroll(_EsdDynamicTransformationScript.navBlock.selector.main);
}
});

// 跳转到正文区域alt+4(52)
$(document).keydown(function(e) {
if (e.altKey && e.keyCode == 52) {
_EsdDynamicTransformationScript.navBlock.keySelectScroll(_EsdDynamicTransformationScript.navBlock.selector.content);
}
});

// 跳转到左区域alt+5(53)
$(document).keydown(function(e) {
if (e.altKey && e.keyCode == 53) {
_EsdDynamicTransformationScript.navBlock.keySelectScroll(_EsdDynamicTransformationScript.navBlock.selector.left);
}
});

// 跳转到右区域alt+6(54)
$(document).keydown(function(e) {
if (e.altKey && e.keyCode == 54) {
_EsdDynamicTransformationScript.navBlock.keySelectScroll(_EsdDynamicTransformationScript.navBlock.selector.right);
}
});
// 跳转到底部alt+7(55)
$(document).keydown(function(e) {
if (e.altKey && e.keyCode == 55) {
_EsdDynamicTransformationScript.navBlock.keySelectScroll(_EsdDynamicTransformationScript.navBlock.selector.footer);
}
});
//前进alt+8(56)
$(document).keydown(function(e) {
if (e.altKey && e.keyCode == 56) {
if (_EsdDynamicTransformationScript.navBlock.sIndex < _EsdDynamicTransformationScript.navBlock.maxIndex) {
_EsdDynamicTransformationScript.navBlock.sIndex++;
_EsdDynamicTransformationScript.navBlock.keyShowSelect(_EsdDynamicTransformationScript.navBlock.sIndex);
}
}
});

// 后退alt+9(57)
$(document).keydown(function(e) {
if (e.altKey && e.keyCode == 57) {
if (_EsdDynamicTransformationScript.navBlock.sIndex > _EsdDynamicTransformationScript.navBlock.minIndex) {
_EsdDynamicTransformationScript.navBlock.sIndex--;
_EsdDynamicTransformationScript.navBlock.keyShowSelect(_EsdDynamicTransformationScript.navBlock.sIndex);
}
}
});
// 特定区域跳转
_EsdDynamicTransformationScript.navBlock.keySelectScroll = function(id) {
if ($(id).length > 0) {
_EsdDynamicTransformationScript.navBlock.appendIns(id,true);//插入ins
_EsdDynamicTransformationScript.navBlock.debugView(id);
$(id).find("a").each(function(index) {
if (index == 0) {
$(this).focus();
}
});
_EsdDynamicTransformationScript.navBlock.appendIns(id,false);//清楚ins
} else {
}

}
//为了解决漂浮高等于0的情况下区域显示是一条线
_EsdDynamicTransformationScript.navBlock.appendIns=function(id,b){
if(b==true){
$(id).append("<ins id='esdNavBlockIns' style='clear: both;display: block;'></ins>")
}else{
$("#esdNavBlockIns").remove();
}
}

if (_EsdDynamicTransformationScript.navBlock.debug == true) {
// 如果开启调试模式，添加调试绘制矩形边线
$("body").append("<div id='show_top' class='lineshow'></div>");
$("body").append("<div id='show_bottom' class='lineshow'></div>");
$("body").append("<div id='show_left' class='lineshow'></div>");
$("body").append("<div id='show_right' class='lineshow'></div>");
$(".lineshow").css({
"display" : "none"
});
}
// 开启调试模式后会显示红边
_EsdDynamicTransformationScript.navBlock.debugView = function(e) {
if (_EsdDynamicTransformationScript.navBlock.debug == true) {
var x = $(e).offset();
//var w = parseInt($(e).css("width"));
var w = $(e).outerWidth();//返回元素的宽度（包含 padding 和 border）
//var h = parseInt($(e).css("height"));
var h = $(e).outerHeight();//返回元素的高度（包含 padding 和 border）
$("#show_top").css({
"z-index" : "9999",
"border" : "red 2px solid",
"position" : "absolute",
"top" : x.top,
"left" : x.left,
"width" : w,
"height" : "0px"
});
$("#show_bottom").css({
"z-index" : "9999",
"border" : "red 2px solid",
"position" : "absolute",
"top" : x.top + h,
"left" : x.left,
"width" : w,
"height" : "0px"
});
$("#show_left").css({
"z-index" : "9999",
"border" : "red 2px solid",
"position" : "absolute",
"top" : x.top,
"left" : x.left,
"width" : "0px",
"height" : h
});
$("#show_right").css({
"z-index" : "9999",
"border" : "red 2px solid",
"position" : "absolute",
"top" : x.top,
"left" : x.left + w,
"width" : "0px",
"height" : h
});
$("html,body").animate({
scrollTop : $("#show_top").offset().top
}, 200);
$(".lineshow").css({
"display" : "block"
});
}
}
};
/**
* 主入口方法
*/

if (window.jQuery == undefined) {
var wzaInitInterval = setInterval(function(){
if(document.body!=null){
clearInterval(wzaInitInterval);
//			var originalWindowOnload = null;
//			if(window.onload!=null){
//				originalWindowOnload = window.onload;
//			}
document.body.onload = function(){
//				originalWindowOnload();
var esdJquery = document.createElement("script");
esdJquery.setAttribute("type", "text/javascript");
esdJquery.setAttribute("src", window.location.protocol + "//" + window.location.href.split("/")[2] + "/wza/bwscript/jquery-1.12.4.min.js");
esdJquery.setAttribute("charset", "utf-8");
esdJquery.setAttribute("id", "ESDWebAppInnerIframe");
document.body.appendChild(esdJquery);
var jqueryLoadInterval = setInterval(function () {
if (window.jQuery != undefined) {
clearInterval(jqueryLoadInterval);
setTimeout( _EsdDynamicTransformationFunction(jQuery) , 1000 );
//						_EsdDynamicTransformationFunction(jQuery)
}
}, 500);
};
}
}, 10);
} else {
jQuery(function(){
setTimeout( _EsdDynamicTransformationFunction(jQuery) , 1000 );
//		_EsdDynamicTransformationFunction(jQuery)
})

}
